package org.ms.userservice.controller;

import org.ms.userservice.model.User;
import org.ms.userservice.service.userService;
import org.ms.userservice.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class userController {
    @Autowired
    userService userService;


    @PostMapping("/user/login")
    public ResponseResult login(@RequestBody User user){
        return  userService.login(user);
    }
    @PostMapping("/user/register")
    public ResponseResult register(@RequestBody User user){
        return userService.register(user);
    }
}
